package thread.producer;

/**
 * Created by simod on 2019/12/22
 */
public class Producer extends Thread {
    private static Factory factory;

    public Producer() {
        factory = FactoryManager.getFactory();
    }

    @Override
    public void run() {
        while (true) {
            factory.add();
            System.out.println("生产者放入");
            try {
                Thread.sleep(300);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
